﻿using System.Linq.Expressions;
using Basic.FormModel.DB;
using Basic.FormModel.QueryTable;
using Basic.FormRemoteModel.QueryTable.Model;

namespace Basic.FormCollect
{
    public interface IQueryTableCollect
    {
        long Add ( PhyQueryTableAdd data, bool isMainTable );

        void Delete ( DBPhysicalQueryTable table );

        DBPhysicalQueryTable Get ( long id );

        Result Get<Result> ( long id ) where Result : class, new();

        bool Set ( DBPhysicalQueryTable table, PhyQueryTableSet set );

        void Clear ( long formId );

        Dictionary<long, string> GetTableName ( long[] ids );
        PhyQueryTable[] Gets ( long[] ids );

        PhyQueryTable[] Gets ( long formId );

        long GetMainTableId ( long formId );

        Result[] GetsByFormId<Result> ( long formId, Expression<Func<DBPhysicalQueryTable, Result>> selector ) where Result : class, new();
    }
}